﻿using System;
using System.Diagnostics;

namespace Hsenl {
    public static class TimeInfo {
        public static float DeltaTime => TimeInfoManager.Instance.DeltaTime;
        public static int FrameCount => TimeInfoManager.Instance.FrameCount;
        public static long Now => TimeInfoManager.Instance.Now;
        public static float Time => TimeInfoManager.Instance.Time;

        public static float TimeScale {
            get => TimeInfoManager.Instance.TimeScale;
            set => TimeInfoManager.Instance.TimeScale = value;
        }

        public static uint CurrentUtcMilliseconds => (uint)DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
        
        private static readonly double _tickPerMs = Stopwatch.Frequency / 1000f;
        public static long GetTickMs() => (long)(Stopwatch.GetTimestamp() / _tickPerMs);
    }
}